-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
whisper: Improve support for local custom Whisper models #3988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
whisper: Improve support for local custom Whisper models #3988
Conversation
- Updated documentation about `custom_model` usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
📝 Walkthrough## Walkthrough
The changes introduce updates to the Whisper add-on for Home Assistant, focusing on enabling and documenting support for local custom Whisper models. The changelog now includes a "2.5.0" section detailing these updates. The documentation has been expanded to provide clear instructions for users on how to use local custom models by copying them into a specific directory and referencing them correctly in the configuration. Additionally, the configuration file has been modified to include a new mapping that allows read-write access to the add-on's configuration directory.
## Changes
| File(s) | Change Summary |
|------------------------|------------------------------------------------------------------------------------------------------------|
| whisper/CHANGELOG.md | Added a "2.5.0" section with entries about local model configuration mapping and documentation updates. |
| whisper/DOCS.md | Expanded documentation for the `custom_model` option, including instructions for using local custom models and backup distinctions. |
| whisper/config.yaml | Updated version to 2.5.0; added a `map` section granting read-write access to the add-on config directory. |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant User
participant HomeAssistant
participant WhisperAddon
User->>HomeAssistant: Copy custom Whisper model to /addon_configs/core_whisper/models/<model-dir>
User->>HomeAssistant: Set custom_model path to /config/models/<model-dir>
HomeAssistant->>WhisperAddon: Start add-on with updated config
WhisperAddon->>WhisperAddon: Access custom model from /config/models/<model-dir>
WhisperAddon-->>User: Use local custom Whisper model for operations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
whisper/DOCS.md (1)
70-74: Normalize inline code formatting
The path snippet is wrapped in both quotes and backticks. Remove the extra quotes so the code renders cleanly:- "`/config/<your-model-dir>`". For a local model, the path must start with `/config/`, as this is how the add-on accesses your Home Assistant configuration directory through the container's mounted volume. + `/config/<your-model-dir>`. For a local model, the path must start with `/config/`, as this is how the add-on accesses your Home Assistant configuration directory through the container's mounted volume.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
whisper/CHANGELOG.md(1 hunks)whisper/DOCS.md(1 hunks)whisper/config.yaml(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
`*/**(html|markdown|md)`: - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure t...
*/**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.
- Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
- In step-by-step instructions, front the location phrase in the instructional sentence.
- In step-by-step instructions, front the 'goal' in the instructional sentence.
- In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
- do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'
whisper/CHANGELOG.mdwhisper/config.yamlwhisper/DOCS.md
`*/**(html|markdown|md)`: - Use bold to mark UI strings. - If "" are used to mark UI strings, replace them by bold.
*/**(html|markdown|md): - Use bold to mark UI strings.
- If "" are used to mark UI strings, replace them by bold.
whisper/CHANGELOG.mdwhisper/config.yamlwhisper/DOCS.md
`*/**(html|markdown|md)`: - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"
*/**(html|markdown|md): - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"
whisper/CHANGELOG.mdwhisper/config.yamlwhisper/DOCS.md
`*/**(html|markdown|md)`: - Use sentence-style capitalization also in headings.
*/**(html|markdown|md): - Use sentence-style capitalization also in headings.
whisper/CHANGELOG.mdwhisper/config.yamlwhisper/DOCS.md
`*/**(html|markdown|md)`: do not comment on HTML used for icons
*/**(html|markdown|md): do not comment on HTML used for icons
whisper/CHANGELOG.mdwhisper/config.yamlwhisper/DOCS.md
`*/**(html|markdown|md)`: Avoid flagging inline HTML for embedding videos in future reviews for this repository.
*/**(html|markdown|md): Avoid flagging inline HTML for embedding videos in future reviews for this repository.
whisper/CHANGELOG.mdwhisper/config.yamlwhisper/DOCS.md
🔇 Additional comments (2)
whisper/config.yaml (1)
15-17: Add mapping for local‑model support
The newmapentry withtype: addon_configandread_only: falsecorrectly exposes/configfor custom Whisper models. Indentation and placement under the top‑level keys align with the add‑on manifest schema.whisper/CHANGELOG.md (1)
3-7: Document Unreleased changes
The## [Unreleased]section and its bullet entries accurately reflect the addition of the local‑model mapping and the documentation update forcustom_model. The format and placement at the top of the changelog match existing conventions.
|
@DT-art1 The backup exclude rule is |
|
Thanks for pointing out the backup aspect. I agree that organizing custom models in a separate sub-directory could be a good approach, but I opted to add an additional rule /data/addon_configs/* to exclude local models from the backup entirely. I believe this approach is simpler and more user-friendly for those who may not have a dedicated sub-directory for their custom models. Let me know if you hare any further thoughts on this. Test output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
whisper/DOCS.md (2)
70-73: Reorder instruction to front the action and improve clarity
The current phrasing leads with the goal; front the action for consistency with other steps. Consider collapsing into two concise sentences:Copy your local Whisper model directory into the add-on configuration at `/addon_configs/core_whisper/<your-model-dir>`. Set the `custom_model` option to `/config/<your-model-dir>`—the path must start with `/config/` so the container can access your Home Assistant configuration volume.
89-90: Remove weak intensifier and front the manual-copy action
Replace “quite large” with “large” and lead with the post-restore action. Example diff:- Whisper model files can be quite large, so they are automatically excluded from backups. The models will be re-downloaded when the backup is restored for a remote model. - If you're using a local custom Whisper model, you will need to manually copy the model directory again after restoring a backup. + Whisper model files can be large, so they are automatically excluded from backups and re-downloaded on restore for remote models. + After restoring a backup with a local custom Whisper model, manually copy your model directory again.🧰 Tools
🪛 LanguageTool
[style] ~89-~89: As an alternative to the over-used intensifier ‘quite’, consider replacing this phrase.
Context: ... ## Backups Whisper model files can be quite large, so they are automatically excluded fro...(EN_WEAK_ADJECTIVE)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
whisper/DOCS.md(2 hunks)whisper/config.yaml(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- whisper/config.yaml
🧰 Additional context used
📓 Path-based instructions (6)
`*/**(html|markdown|md)`: - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure t...
*/**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.
- Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
- In step-by-step instructions, front the location phrase in the instructional sentence.
- In step-by-step instructions, front the 'goal' in the instructional sentence.
- In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
- do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'
whisper/DOCS.md
`*/**(html|markdown|md)`: - Use bold to mark UI strings. - If "" are used to mark UI strings, replace them by bold.
*/**(html|markdown|md): - Use bold to mark UI strings.
- If "" are used to mark UI strings, replace them by bold.
whisper/DOCS.md
`*/**(html|markdown|md)`: - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"
*/**(html|markdown|md): - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"
whisper/DOCS.md
`*/**(html|markdown|md)`: - Use sentence-style capitalization also in headings.
*/**(html|markdown|md): - Use sentence-style capitalization also in headings.
whisper/DOCS.md
`*/**(html|markdown|md)`: do not comment on HTML used for icons
*/**(html|markdown|md): do not comment on HTML used for icons
whisper/DOCS.md
`*/**(html|markdown|md)`: Avoid flagging inline HTML for embedding videos in future reviews for this repository.
*/**(html|markdown|md): Avoid flagging inline HTML for embedding videos in future reviews for this repository.
whisper/DOCS.md
🪛 LanguageTool
whisper/DOCS.md
[style] ~89-~89: As an alternative to the over-used intensifier ‘quite’, consider replacing this phrase.
Context: ... ## Backups Whisper model files can be quite large, so they are automatically excluded fro...
(EN_WEAK_ADJECTIVE)
|
Just want to confirm with @agners that the backup exclude rule will work. Otherwise, looks good to me 👍 |
|
LGTM, thanks! |
Proposed change
This updates the 'whisper' add-on to clarify how to configure and use a local custom Whisper model.
Changes:
custom_modelusage.Summary by CodeRabbit
Documentation
Chores